public class HomeWork01143 {
    public static void main(String[] args) {
//if判断2
        String username = "admin";
        String password = "password123";
        boolean isAccountAcitve = true;
        boolean hasRecentLogin = true;


        //判断用户登录是否成功
        if (isAccountAcitve && hasRecentLogin &&
        isValidCredentials(username,password)) {
            System.out.println("Login successful.Welcome back," + username + "！");
        }else{System.out.println("Login failed.Please check your credentials and account status");

        }

    }
    public static boolean isValidCredentials(String username,String password){
        return username .equals("admin")&& password.equals("password123");
//验证用户名和密码
    }
}

